package hc.bre.cmn;

public interface IDataDefOption extends IListOption {
	public String getType();

	public void setType(String type);

	default String declarationOfData() {
		return declarationOfData(this);
	}

	static String declarationOfData(IDataDefOption dataDef) {
		String type = dataDef.getType();
		if ("text".equals(type)) {
			type = "String";
		} else if ("number".equals(type)) {
			type = "BigDecimal";
		} else if ("object".equals(type)) {
			type = "Object";
		} else {
			assert false;
		}

		return type + " " + dataDef.getCode() + ";";
	}
}
